package com.shelpe.services.simbasync.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.shelpe.services.simbasync.model.Campaigns;
import com.shelpe.services.simbasync.model.RptCampaign;


public interface CampaignsService {
	
	public int countAll();
	
	public int countByUserId(long userId);
	
	public int addCampaigns(Campaigns cam);
	
	public int addCampaignsList(List<Campaigns> list);
	
	public int addRptCampaigns(RptCampaign rpt);
	
	public int deleteRptCampaignsByDateRange(List<Long> userIds, Date startDate, Date endDate);
	
	public int deleteRptCampaignsByDateRangeCamIds(List<Long> campaignIds, Date startDate, Date endDate);
	
	public int addRptCampaignsList(List<RptCampaign> rptList);
	
	public int insertRptCampaignsBatch(List<RptCampaign> rptList);
	
	public List<Campaigns> getCampaignsByNick(String nick);
	
	public List<Campaigns> getCampaignsByUserId(Long userId);
	
	public Campaigns getCampaignById(long campaignId);
	
	public int deleteCampaigns(Campaigns ad);
	
	public int deleteCampaignsList(List<Campaigns> adList);
	
	public int updateCampaigns(Campaigns ad);
	
	public int updateCampaignsList(List<Campaigns> adList);
	
	public Date getLastTimeFromRpt(long userId);
	
	public Date getLastTimeFromRptByCampaign(long userId, long campaignId);
	
	public void updateCampaignsData(long userId, List<Campaigns> list, boolean singleThread);
	
	/*********************************************************/
	
	public List<Campaigns> parseJsonToCampaigns(String response);

	public Map<String, List<Campaigns> > splitCampaigns(List<Campaigns> newList, List<Campaigns> oldList);
	
	public List<RptCampaign> parseJsonToRptCampaignsBase(String response);
	
	public int combineRptCampaignEffect(String response, Map<String, Integer> lastDayRecord, List<RptCampaign> list);
	
	public void updateRptCampaignsData(long userId, List<RptCampaign> list);

}